home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d14 / emag10.arc / EMAG10T.TXT next >
Text File  |  1991-01-02  |  61KB  |  1,366 lines

  1.                  OnLine's Electronic Magazine (EMAG)
  2.                               Issue #10
  3.                                    
  4. The tenth issue of OnLine's Electronic Magazine (EMAG) is available
  5. for downloading in the Software Library. The file is EMAG10.ARC.
  6. Microsoft has created this magazine to provide our OnLine customers
  7. with information about the OnLine service, including techniques on how
  8. to most effectively use the service. We also hope the magazine will
  9. encourage you to send us feedback so that we can provide the best
  10. possible service to you, our OnLine customers.
  11.                                    
  12.                           Table of Contents
  13.                           -----------------
  14.  
  15. Word 5.50 Introduction.......................................EMAG10-1
  16.  
  17. Converting Word 5.00 Macros for Use in Word 5.50.............EMAG10-2
  18.  
  19. Word Version 5.50 Articles..............by Microsoft OnLine Personnel
  20.  
  21. (The information in these articles may also be found in the Knowledge
  22. Base by searching on the appropriate Q number shown in parentheses).
  23.    
  24.    Word 5.50: Viewing List Box Contents Without a Mouse
  25.    (Word, Q67191)............................................EMAG10-3
  26.    
  27.    Word 5.50: Installing Mouse Driver and Updating System
  28.    (Word, Q66066)............................................EMAG10-4
  29.    
  30.    Word 5.50: New Command-Line Switches
  31.    (Word, Q66133)............................................EMAG10-5
  32.    
  33.    Word 5.50 Freeing Up Memory When Shelling Out
  34.    (Word, Q66065)............................................EMAG10-6
  35.    
  36.    Word 5.50: Setup Does Not Overwrite Word Version 4.00
  37.    (Word, Q67157)............................................EMAG10-7
  38.    
  39.    Decompressing Word 5.50 Files with Setup
  40.    (Word, Q64464)............................................EMAG10-8
  41.    
  42.    WORD.PIF Settings for Windows 3.00
  43.    (Word, Q65737)............................................EMAG10-9
  44.    
  45.    
  46. What's New.............................by Microsoft Support Personnel
  47.  
  48. (The information in these articles may also be found in the Knowledge
  49. Base by searching on the appropriate Q number shown in parentheses).
  50.    
  51.    Accessing Program Segment Prefix in OS/2 Bound Program
  52.    (OS/2 SDK, Q66821).......................................EMAG10-10
  53.    
  54.    COM/Serial Port Detection in OS/2
  55.    (OS/2 SDK, Q66236).......................................EMAG10-11
  56.    
  57.    PM: Determining Which Button Is the Default or Focused Button
  58.    (Presentation Manager, Q65966)...........................EMAG10-12
  59.    
  60.    Adding and Removing FCF_SIZEBORDER Style of a PM Frame Window
  61.    (Presentation Manager, Q66464)...........................EMAG10-13
  62.    
  63.    Memory Requirements for Real-Mode CodeView (CV.EXE)
  64.    (CodeView, Q66513).......................................EMAG10-14
  65.    
  66.    How to Add Other Language Compilers to PWB's Build Options
  67.    (PWB, Q65568)............................................EMAG10-15
  68.    
  69.    What Happens to Stack Memory When Thread Terminates?
  70.    (C Compiler, Q66295).....................................EMAG10-16
  71.    
  72.    Using _psp for Pointer Checking
  73.    (C Compiler, Q66127).....................................EMAG10-17
  74.    
  75.    Differences/Enhancements from BASIC PDS 7.00 to 7.10
  76.    (BASIC Compiler, Q65598).................................EMAG10-18
  77.    
  78.     How SUB and FUNCTION Windows Inherit DEFtype in QB.EXE Editor
  79.    (QuickBASIC, Q47491).....................................EMAG10-19
  80.    
  81.    Description of Stub Files and How They May Enlarge EXE
  82.    (BASIC Compiler, Q62908).................................EMAG10-20
  83.    
  84.    Which BASIC Versions Can CALL C, FORTRAN, Pascal, MASM
  85.    (QuickBASIC, Q35965).....................................EMAG10-21
  86.    
  87. ======================================================================
  88.                                EMAG10-1
  89.                         Word 5.50 Introduction
  90.                           By Donna Inchinose
  91.  
  92. This new version of Microsoft Word has been designed with two major
  93. goals in mind -- making the product easy to learn, as well as easy to
  94. use. To accomplish these goals, Microsoft has changed the interface,
  95. or the way Word looks, to a character window (CW) interface. The
  96. advantages of this new interface are:
  97.  
  98. 1. A new, more intuitive menu system that includes a menu bar along
  99.    the top of the screen with pull down menus that allow you to see
  100.    all the commands available to you. Each of the menu groups contains
  101.    commands that are similar or related in function.
  102.  
  103. 2. The ability to have up to 9 documents or style sheets open at one
  104.    time in overlapping windows, or 10 windows if you count the help
  105.    window.
  106.  
  107. 3. Easy referral to Help, in a window that can remain open as you work
  108.    on your document.
  109.  
  110. 4. A formatting ribbon that will allow you to immediately see what
  111.    font or font size your text is formatted for, as well as allow you
  112.    to easily format your text for a font, font size, or paragraph
  113.    style from your stylesheet.
  114.  
  115. 5. Speed-formatting keys for character formats.
  116.  
  117. 6. A flashing underscore, instead of a single selected character
  118.    (block), as its cursor to mark the insertion point. This eliminates
  119.    the need for applying character formatting twice when you are
  120.    trying to format a single character.
  121.  
  122. The character window interface also follows a standard function key
  123. assignment that is consistent with our other Word products, such as
  124. Word for Windows and Word for the Macintosh. These function key
  125. assignments differ from the key assignments in Word 5.00, but to
  126. assist you in adjusting to this new interface if you are using Word
  127. 5.00, we have added the ability to retain the Word 5.00 function
  128. assignments. You choose this option either when you run the Setup
  129. program or by choosing the Customize dialog box from the Utilities
  130. menu and checking the box next to "Use Word 5.0 Function Keys". The
  131. functions of the DEL and INS keys are also different in the character
  132. window interface, where INS and DEL will NOT insert from or delete to
  133. the scrap. To retain the functionality of the INS and DEL keys
  134. available with Word 5.00, you can uncheck the box next to "Use INS for
  135. Overtype Key" in the Customize dialog box of the Utilities menu.
  136.  
  137. This new interface will also pose a few hurdles for Word 5.00 macros.
  138. With the new interface, keystroke sequences to access Word's powerful
  139. word processing features have changed. To assist you in updating your
  140. Word 5.00 macros to run in Word 5.50, we have included the utility
  141. MACROCNV.EXE. This macro converter is meant only as a tool to assist
  142. you in converting your macros. Once you have converted macros with the
  143. macro converter, it will be necessary for you to review and edit your
  144. macros to optimize them to your exact needs. Please be aware that the
  145. macro converter cannot convert 100 percent of the commands in your
  146. macros.
  147.  
  148. For more information about what is new with Word, please refer to
  149. Chapter 1 of the "Getting Started" pamphlet included with your Word
  150. 5.50 documentation.
  151.  
  152. ======================================================================
  153.                                EMAG10-2
  154.            Converting Word 5.00 Macros for Use in Word 5.50
  155.                           by Charlie Gifford
  156.  
  157. There are major differences between the Microsoft Word version 5.50
  158. character windows interface and the Microsoft Word version 5.00
  159. multitool interface. As a result, Word 5.00 macros converted by the
  160. macro conversion utility, MACROCNV.EXE, may not run correctly in Word
  161. 5.50.
  162.  
  163. MACROCNV.EXE is a tool designed to help you convert Word 5.00 macros
  164. for use in Word 5.50. Some Word 5.00 macros may convert incorrectly or
  165. contain unnecessary commands that require editing before the macro is
  166. run in Word 5.50. After conversion, all macros should be executed with
  167. a test document. Be sure to make backup copies of any documents that
  168. are to be modified by a newly converted macro.
  169.  
  170. The macro converter creates a backup copy of your Word 5.00 glossary
  171. files by renaming the Word 5.00 glossary with a "GL5" extension.
  172.  
  173. Converted macros can be edited with the Word 5.50 Macro Edit command.
  174.  
  175. Limitations and/or Potential Problems with the Macro Converter
  176. --------------------------------------------------------------
  177.  
  178. Speed keys (used to invoke the macro) assigned to Word 5.00 macros,
  179. may conflict with Word 5.50 built-in speed keys. Changing the speed
  180. keys that are assigned in the converted macro, or using CTRL+A before
  181. pressing the speed-key combination will solve this problem. If you
  182. have assigned the speed-key combination CTRL+A to a Word 5.00 macro,
  183. you should change this key combination to something new before running
  184. the converted macro in Word 5.50.
  185.  
  186. Macros that use the F1 key to display a list of files in Word 5.00
  187. will be converted so that the macro will pause and allow you to select
  188. a file from a files list box.
  189.  
  190. Written or recorded macros that assume certain Word 5.00 menu settings
  191. will not convert correctly. The most common macro instruction that
  192. poses a problem for the macro converter is a recorded macro that
  193. selects menu options with the SPACEBAR, instead of the first letter of
  194. the menu option.
  195.  
  196. "Run time" decisions made by Word while the macro is running may not
  197. convert correctly. For example, the ENTER key will be interpreted
  198. differently if Word is spell checking, in the Thesaurus or Gallery, or
  199. in the document view. There is no way for the macro converter to tell
  200. whether ENTER means to check the spelling of the next word, insert a
  201. paragraph mark in the document, or carry out a menu command. In the
  202. Word 5.00 Gallery, if you choose to format a style, Word recognizes at
  203. run time whether it is a character, paragraph, or section format and
  204. takes you to the appropriate menu. There is no way for the macro
  205. converter to identify the type of format chosen. Another run time
  206. decision is made with macros that set the promptmode variable to Yes.
  207. There is no way to determine the user's response to the prompt and
  208. guarantee a value for a macro variable.
  209.  
  210. If a Word 5.00 macro changes several fields in one command menu, the
  211. Word 5.50 macro may have to choose more than one menu to make the same
  212. changes. For example, settings that can be accessed through the Word
  213. 5.00 Options menu may now require the macro to choose the Word 5.50
  214. View and Utilities menus.
  215.  
  216. Macro translation may be further complicated if you must press ENTER
  217. or ESC to leave a dialog box in Word 5.00. If the macro converter adds
  218. an ENTER-key press, additional options in Word 5.50 may be carried out
  219. unintentionally. If the macro converter adds ESC to a macro, options
  220. set in a dialog box may be canceled. Word 5.00 commands that may cause
  221. problems similar to these include Format Division Margins, Search,
  222. Replace, Options, and Print Options.
  223.  
  224. Word 5.00 macros that involve moving, splitting, or sizing windows,
  225. and moving from window to window may not convert properly. Because of
  226. Word 5.50's support of overlapping windows, the Window Split
  227. Horizontal and Window Split Vertical commands are not valid for Word
  228. 5.50 and are ignored by the macro converter.
  229.  
  230. The following Word 5.00 macro actions may not convert properly:
  231. selecting Library Document-Retrieval and changing the pathname, and
  232. using Transfer Allsave when glossaries, style sheets, or unnamed
  233. documents have not been saved.
  234.  
  235. Macros containing nested macros and conditional statements may not be
  236. converted correctly. Most macros containing nested macros can be
  237. successfully converted if the macro is called from edit mode. If a
  238. function key is used to call a macro, the macro converter assumes that
  239. a built-in function is being used. The macro converter is restricted
  240. to one level of IF statements; nested IF statements cannot be
  241. converted.
  242.  
  243. Workarounds
  244. -----------
  245.  
  246. If you edit a macro and still encounter problems executing the
  247. converted macro, you may want to consider recording the macro in Word
  248. 5.50. This may save you time in the long run.
  249.  
  250. If you encounter problems converting a Word 5.00 macro, you can load
  251. your Word 5.50 document into Word 5.00, run your old macro in Word
  252. 5.00 on your Word 5.50 document, then load your modified document back
  253. into Word 5.50. This may be helpful if you are under a deadline to
  254. finish a document and don't have the time to edit the converted macro
  255. right away.
  256.  
  257. ======================================================================
  258.                           Word Version 5.50
  259.                 by Microsoft Product Support Personnel
  260.                                    
  261.                                EMAG10-3
  262.          Word 5.50: Viewing List Box Contents Without a Mouse
  263.                             (Word, Q67191)
  264.  
  265. To view the contents of a drop down list box without the use of a
  266. mouse, do the following:
  267.  
  268. Select the contents of the field and hold down the ALT key and press
  269. the DOWN ARROW key (ALT+DOWN ARROW). This will display a list of
  270. options available to this field.
  271.  
  272. Example 1
  273. ---------
  274.  
  275. To view the list of available fonts in the Format Character dialog
  276. box:
  277.  
  278. 1. From the Format menu, choose Character (ALT, T, C).
  279.  
  280. 2. Hold down the ALT key and press the DOWN ARROW key (ALT+DOWN
  281.    ARROW).
  282.  
  283. A list of available fonts will now appear in a drop down list box.
  284.  
  285. Example 2
  286. ---------
  287.  
  288. To view the list of available fonts from the ribbon:
  289.  
  290. 1. Activate the ribbon (if not active) with ALT+V+B.
  291.  
  292. 2. Hold down the CTRL key and press the F key (CTRL+F).
  293.  
  294. 3. Hold down the ALT key and press the DOWN ARROW key (ALT+DOWN
  295.    ARROW).
  296.  
  297. A list of available fonts will now appear in a drop down list box.
  298.  
  299. ======================================================================
  300.                                EMAG10-4
  301.         Word 5.50: Installing Mouse Driver and Updating System
  302.                             (Word, Q66066)
  303.  
  304. When running the Word 5.50 Setup program for a DOS-based computer
  305. system with a mouse pointing device, select the "Update the mouse
  306. driver" and "Update the system files" options to ensure that the
  307. updated mouse driver is installed properly.
  308.  
  309. If the "Update the mouse driver" option is selected and the option to
  310. "Update the system files" is not selected, the Setup program will only
  311. copy the updated mouse driver (MOUSE.SYS) to the Word program
  312. directory and not add the necessary device line to the CONFIG.SYS file
  313. to use the new mouse driver.
  314.  
  315. To add the device line to the CONFIG.SYS file, the Setup program can
  316. be run with the option to "Modify an existing version of Word." Choose
  317. to "Install a mouse" and have the Setup program modify the system
  318. files. (You can also manually add a line to the CONFIG.SYS file to
  319. include the path to the updated MOUSE.SYS file, that is,
  320. device=c:\mouse.sys).
  321.  
  322. If the mouse being used is not a Microsoft or IBM PS/2-compatible
  323. mouse, it is strongly suggested that the manufacturer's mouse driver
  324. be used. If there are problems relating to a manufacturer's mouse in
  325. Word, contact the manufacturer of the mouse regarding a possible
  326. updated mouse driver to use with Microsoft Word version 5.50.
  327.  
  328. Microsoft System Diagnostics can be used to determine the mouse driver
  329. version that is being loaded on startup.
  330.  
  331. ======================================================================
  332.                                EMAG10-5
  333.                  Word 5.50: New Command-Line Switches
  334.                             (Word, Q66133)
  335.  
  336. The following is a list of new command-line switches for Microsoft
  337. Word version 5.50. To use any of the following switches, type "word
  338. /(switch)" at the command prompt (for example, "word /z"):
  339.  
  340.    Switch              Function
  341.    ------              --------
  342.    
  343.    /i                  Turns cursor blinking off in graphics mode.
  344.    /m (macroname)      Loads a macro from NORMAL.GLY automatically on
  345.                        startup.
  346.    /p                  Uses Word 5.50 function keys and uses INS to
  347.                        toggle Overtype.
  348.    /t                  Uses Word 5.00 function keys and uses INS to
  349.                        insert text from scrap.
  350.    /w                  Ignores line spacing at the top of a page so
  351.                        that when the last line in the window is
  352.                        reached, Word wraps text to the top of a new
  353.                        window and starts a new line.
  354.    /z                  Returns all switches back to the Word 5.50
  355.                        defaults.
  356.  
  357. Additional switches available in previous versions of Microsoft Word
  358. and Word version 5.50:
  359.  
  360.    Switch              Function
  361.    ------              --------
  362.    
  363.    /bn                 Specifies the number of internal page buffers
  364.    for
  365.                        expanded memory (number between 4 and 1500).
  366.    /k                  Disables an enhanced keyboard.
  367.    /l                  Opens the last document edited during the last
  368.                        Word session.
  369.    /n                  For use with a Novell network.
  370.    /x                  Disables expanded memory.
  371.    /y                  Enables Word 4.00 scrolling.
  372.  
  373. ======================================================================
  374.                                EMAG10-6
  375.             Word 5.50 Freeing Up Memory When Shelling Out
  376.                             (Word, Q66065)
  377.  
  378. When selecting DOS commands or OS/2 commands from the File menu in
  379. Microsoft Word version 5.50, include the extension of the program to
  380. run from the operating system shell (for example, COMMAND.COM instead
  381. of COMMAND) in order to free up memory. If the file extension (.COM,
  382. .EXE) is included, Word will throw away its page buffers and close any
  383. open files, making more memory and file handles available to programs
  384. executed from the operating system shell.
  385.  
  386. Because Word 5.50 will close any open files if the file extension is
  387. included, you must be careful not to modify any files that will be
  388. reopened by Word when the operating system shell is exited and control
  389. is returned to Word. If a file is modified, Word may be unable to
  390. continue or the file may become corrupted.
  391.  
  392. Page buffers are 512-byte blocks of memory that contain document text.
  393. The number of page buffers created by Word is determined by the amount
  394. of memory available. If no expanded memory is available, the size of
  395. the page buffers cannot exceed 64K. When Word throws away its page
  396. buffers to execute an operating system shell, approximately 50K of
  397. memory will be freed.
  398.  
  399. File handles are 16-bit numbers that the operating system uses to
  400. identify open files and/or to identify other input/output sources for
  401. a program. The default internal data structure for DOS only allows for
  402. eight file handles. The number of file handles can be increased with
  403. the use of the FILES command in the CONFIG.SYS file (for example,
  404. Files=20).
  405.  
  406. ======================================================================
  407.                                EMAG10-7
  408.         Word 5.50: Setup Does Not Overwrite Word Version 4.00
  409.                             (Word, Q67157)
  410.  
  411. The Setup program for Microsoft Word version 5.50 will not overwrite
  412. an existing installation of Word version 4.00 or earlier.
  413.  
  414. If a previous version of Word (version 4.00 or earlier) exists in the
  415. same subdirectory that Word version 5.50 is installed in (for example,
  416. C:\WORD), the program files of the previous version are not
  417. overwritten.
  418.  
  419. To manually remove the previous version of Word, delete or rename the
  420. WORD.COM and WORD.PGM files from the Word program directory. This will
  421. not affect the Word version 5.50 installation because the Word version
  422. 5.50 executable file is WORD.EXE.
  423.  
  424. The "Install a new version of Word" option in the Word 5.50 Setup
  425. program only overwrites the Word version 5.00 program file (WORD.EXE).
  426.  
  427. ======================================================================
  428.                                    
  429.                                EMAG10-8
  430.                Decompressing Word 5.50 Files with Setup
  431.                             (Word, Q64464)
  432.  
  433. The majority of the files on the Word 5.50 disks are compressed, and
  434. can be distinguished from the uncompressed files on disk by the dollar
  435. sign ($) that occupies the last character position in the file
  436. extension.
  437.  
  438. The Setup program will automatically decompress a compressed file when
  439. it copies the file to disk during the installation of Word 5.50. Setup
  440. can also be used to decompress a file, using the following command
  441. syntax:
  442.  
  443.    SETUP /d [source file] [destination file]
  444.  
  445. Setup must be able to locate the WORD55.INF and PRD.INF installation
  446. information files in the directory from which it is invoked. If these
  447. files cannot be found, Setup will display the message "Information
  448. file is not in current directory" and will not properly decompress the
  449. file.
  450.  
  451. If no destination file is specified when Setup is invoked, Setup will
  452. create an uncompressed file on disk with the name that is stored in
  453. the compressed file's header.
  454.  
  455. ======================================================================
  456.                                EMAG10-9
  457.                   WORD.PIF Settings for Windows 3.00
  458.                             (Word, 65737)
  459.  
  460. Microsoft Word version 5.50 includes a Program Information File (PIF)
  461. called WORD.PIF for use with Microsoft Windows version 3.00. Because
  462. Word 5.50 is a non-Windows application, it is strongly recommended
  463. that Word 5.50 be started from WORD.PIF when running Word from Windows
  464. 3.00.
  465.  
  466. To set up Word 5.50 to run from the Windows 3.00 "Non-Windows
  467. Applications" group using WORD.PIF, follow these steps:
  468.  
  469. 1. From the Window menu of the Windows 3.00 Program Manager choose
  470.    "Non-Windows Applications" (another group name may be substituted).
  471.  
  472. 2. From File menu of Program Manager, select New.
  473.  
  474. 3. Select Program Item, and click OK or press ENTER.
  475.  
  476. 4. The Program Item Properties screen will appear.
  477.  
  478.    Beside the Description field, type "Word 5.50". The contents of the
  479.    Description field are optional. The description text that is
  480.    entered will appear under the icon associated with the Word 5.50
  481.    program item.
  482.  
  483.    Beside the Command Line field, type the drive and directory path to
  484.    the location of WORD.PIF (for example, C:\WORD\WORD.PIF).
  485.  
  486. 5. Select OK.
  487.  
  488.    A new program item icon will appear in the active group (Non-
  489.    Windows Applications). Word can now be started from Windows by
  490.    double-clicking the new icon.
  491.  
  492. WORD.PIF settings (for use with Windows 3.00) are as follows:
  493.  
  494.    Program Filename:        WORD.EXE
  495.    Window Title:            Microsoft Word 5.5
  496.    Optional Parameters:     None
  497.    Start-up Directory:      None
  498.    Memory Requirements:     KB Required: 384
  499.                             KB Desired:  640
  500.    Display Usage:           Full Screen
  501.    Execution:               Exclusive
  502.    Close Window on Exit:    Yes
  503.  
  504. Note: SETUP.EXE does not modify the WORD.PIF settings to reflect any
  505. options selected or specified during installation.
  506.  
  507. The Windows 3.00 PIF Editor can be used to customize the WORD.PIF
  508. included with Word 5.50. Use the Start-Up Directory and Optional
  509. Parameters fields to customize the WORD.PIF file. Changing the memory
  510. requirements in the KB Required field to a value less than 384 KB
  511. (kilobytes) is not recommended.
  512.  
  513. The following are Advanced Options (available under 386 enhanced mode
  514. only):
  515.  
  516.    Multitasking Options:    Background Priority: 50
  517.                             Foreground Priority: 100
  518.                             Detect Idle Time:    Yes
  519.    Memory Options:
  520.    
  521.    EMS Memory:              KB Required: 0  KB Limit: 1024  Locked: No
  522.    XMS Memory:              KB Required: 0  KB Limit: 1024  Locked: No
  523.    Uses High Memory Area:    Yes (checked)
  524.    Lock Application Memory: No (unchecked)
  525.    Display Options:         Video memory: High Graphics
  526.    Monitor Ports:           Text (checked), Low Graphics (checked)
  527.    Emulate Text Mode:       Yes (checked)
  528.    Retain Video Memory:     Yes (checked)
  529.  
  530. Note: Word 5.50 can access expanded memory (EMS) that meets the Lotus-
  531. Intel-Microsoft (LIM) specification versions 3.20 or later. To allow
  532. Word to access expanded memory when running under Windows 386 enhanced
  533. mode, indicate a value (other than zero) in the Advance Options, EMS
  534. Memory (KB Required) section of the PIF file. Word 5.50 does not use
  535. extended memory (XMS).
  536.  
  537. The following are other options:
  538.  
  539.    Allow Fast Paste:        No (unchecked)
  540.    Allow Close When active: No (unchecked)
  541.    Reserve Shortcut Keys:
  542.                             ALT+TAB:     No (unchecked)
  543.                             PRTSC:       No (unchecked)
  544.                             ALT+ENTER:   No (unchecked)
  545.                             ALT+ESC:     No (unchecked)
  546.                             ALT+PRTSC:   No (unchecked)
  547.                             CTRL+ESC:    No (unchecked)
  548.                             ALT+SPACE:   Yes (checked)
  549.  
  550. Application Shortcut Key: None
  551.  
  552. ======================================================================
  553.                               What's New
  554.                 by Microsoft Product Support Personnel
  555.                                    
  556.                               EMAG10-10
  557.         Accessing Program Segment Prefix in OS/2 Bound Program
  558.                           (OS/2 SDK, Q66821)
  559.  
  560. Question:
  561.  
  562. I have a bound application program that runs in OS/2 and MS-DOS. This
  563. program is a type of "shell" that spawns other programs. However, in
  564. MS-DOS, the shell takes up too much memory to run large programs, such
  565. as the Microsoft C Compiler version 6.00. Therefore, I am interested
  566. in using the do_exec and do_spawn functions that were presented in the
  567. article by Marc Adler in the September 1990 issue of the "Microsoft
  568. Systems Journal," titled "Spawn Programs from Within Your DOS
  569. Application Using Almost No Additional Memory."
  570.  
  571. I have downloaded the source code and examined it. It uses some C run-
  572. time functions such as INTDOS and INTDOSX that are not in the
  573. protected mode versions of the C run-time libraries. This is no
  574. problem because I can substitute FAPI calls for them to get the
  575. information they need. However, the SPAWN.ASM module needs to access
  576. the program segment prefix (PSP), and it tries to get the PSP's
  577. address by referencing the external variable _psp. This variable is
  578. not defined in the protected mode C run-time libraries. I assume that
  579. it was omitted because protected mode programs running in OS/2 really
  580. have no need to access the PSP. What about a bound version of the
  581. program running in MS-DOS? Is the PSP the same, and if it is, is there
  582. any way a bound program can access it (perhaps through a register)?
  583.  
  584. Will the technique used in the do_spawn function to swap programs in
  585. MS-DOS work at all for a bound program? If it will work, how should I
  586. adapt the code?
  587.  
  588. Response:
  589.  
  590. You are correct that the run-time library global variable _psp has
  591. been removed from the protected mode run-time libraries; OS/2 programs
  592. do not have a PSP. However, a bound program does construct a PSP for
  593. compatibility with older MS-DOS programs; you just don't have a _psp
  594. to use to get to it.
  595.  
  596. However, you can call MS-DOS interrupt 0x21 function 0x51 to get the
  597. address of your PSP when you are running a bound program in real mode
  598. or under MS-DOS. If you put 0x51 into AH and call INT 21, the segment
  599. of your PSP is returned in BX. The offset of the PSP into that segment
  600. is 0 (zero). Be sure to call DosGetMachineMode() before calling this
  601. interrupt. You cannot call this interrupt while running in protected
  602. mode.
  603.  
  604. The following is a small sample program that shows how to access the
  605. PSP using this interrupt in a bound program:
  606.  
  607.     #define INCL_DOSMISC
  608.     #include <os2.h>
  609.     #include <stdio.h>
  610.     #include <stdlib.h>
  611.     #include <dos.h>
  612.     #include <memory.h>
  613.  
  614.     main()
  615.     {
  616.       BYTE bMachineMode;
  617.       USHORT usPspSeg;
  618.  
  619.       if (DosGetMachineMode(&bMachineMode))
  620.         {
  621.         puts("error in DosGetMachineMode()");
  622.         exit(1);
  623.         }
  624.       if (bMachineMode == MODE_REAL)
  625.         {
  626.         _asm
  627.           {
  628.           mov ah, 51h
  629.           int 21h
  630.           mov usPspSeg, bx
  631.           }
  632.         printf("PSP = 0x%04x\n", usPspSeg);
  633.         }
  634.       return(0);
  635.     }
  636.  
  637. ======================================================================
  638.                               EMAG10-11
  639.                   COM/Serial Port Detection in OS/2
  640.                           (OS/2 SDK, Q66236)
  641.  
  642. Question:
  643.  
  644. Is it possible to determine if a physical COM board is installed for a
  645. given COM/serial port? I have a program that requests, and is granted,
  646. access to read/write to COM2 (0x2f8 -> 0x2f2) via the DosPortAccess()
  647. function. Access is granted, but on some machines (not all), if a COM2
  648. port is not physically installed, a protection fault is produced.
  649.  
  650. Response:
  651.  
  652. It is possible to do this, but you shouldn't use the DosPortAccess()
  653. function. DosPortAccess() is essentially an NOP that always returns
  654. success. It has been abandoned in OS/2 version 2.00.
  655.  
  656. One of the easiest ways to detect if a COM port is present is to try
  657. to open the port using the DosOpen() function. By checking the return
  658. code value, you should be able to detect whether the hardware is
  659. present.
  660.  
  661. Another more difficult method is to actually write to the port
  662. registers and read back the expected results. This involves setting up
  663. IOPL segments in your application. This method is supported in OS/2
  664. versions 1.10 and 1.21.
  665.  
  666. For more information, please refer to Chapter 14 of "Advanced OS/2
  667. Programming" by Ray Duncan. This will help you set up the segments
  668. properly. You then must decide which register you want to write to. On
  669. an 8250, there is a scratch register that is safe to read and write
  670. to. For COM2, the I/O address is 0x2FF. It is always the last register
  671. you can write to, 0xXXF. The 8250 is probably the most common chip
  672. used for COM ports on PCs. However, it is starting to be replaced by
  673. 16450s and 16550s.
  674.  
  675. ======================================================================
  676.                               EMAG10-12
  677.     PM: Determining Which Button Is the Default or Focused Button
  678.                     (Presentation Manager, Q65966)
  679.  
  680. Question:
  681.  
  682. In my dialog box, I have some entry fields and some buttons. By using
  683. the TAB key, I can navigate through entry fields and buttons. When I
  684. come to a button, the button gets the focus (a dotted-line cursor is
  685. inside) and the button becomes the default (a heavy dark border is
  686. displayed).
  687.  
  688. I have some buttons that I do not want to ever become the default
  689. buttons -- just focused (that is, callable with the SPACEBAR key and
  690. not with the ENTER key).
  691.  
  692. How can I disallow buttons from becoming the default button? Also, how
  693. can I query the dialog box to find out which button is the default or
  694. focused button?
  695.  
  696. Response:
  697.  
  698. The message you should be concerned with is BM_SETDEFAULT. This
  699. message is sent to a button when that button is about to become the
  700. default button.
  701.  
  702. You can disallow buttons from becoming the default button by
  703. subclassing the button. Send most messages through to the old button
  704. window procedure. However, screen out the BM_SETDEFAULT message. If
  705. this message does not get through to the old window procedure, then
  706. the button will not become the default.
  707.  
  708. Simply subclassing one button in order to cause it to refuse accepting
  709. the default will result in a situation in which no button has the
  710. default. For this reason, you may want to send this same message to
  711. some other button at the time your button screens it out.
  712.  
  713. A button that has the default has the BS_DEFAULT style bit turned on.
  714. You may get all of the style bits for any window by using
  715. WinQueryWindowULong(., QWL_SYTLE). Obviously, you will have to step
  716. through and check each one of the button HWNDs.
  717.  
  718. The best way to determine focus is by using the WinQueryFocus() call.
  719. This method is different from the above method in that only one call
  720. is required, and the result you receive will not necessarily be an
  721. HWND in your own application.
  722.  
  723. ======================================================================
  724.                               EMAG10-13
  725.     Adding and Removing FCF_SIZEBORDER Style of a PM Frame Window
  726.                     (Presentation Manager, Q66464)
  727.  
  728. Question:
  729.  
  730. How can I update the frame controls of a window already on the screen?
  731. Also, how can I obtain the frame-style bits so that I can change from
  732. a size border to no border, and vice versa?
  733.  
  734. Response:
  735.  
  736. You need to change the style bits and send a WM_UPDATEFRAME message to
  737. the frame.
  738.  
  739. Adding or removing the size border from a frame window is a little
  740. different from adding or removing other frame controls. This is
  741. because the size border is not a window. Therefore, you do not need to
  742. destroy any windows, as you would if you were to remove the MINMAX
  743. button.
  744.  
  745. The following is the code you need to add to perform this type of
  746. functionality:
  747.  
  748.         ; Remove the size border.
  749.         WinSetWindowBits( hwndFrame, QWL_STYLE, ~FS_SIZEBORDER,
  750.                           FS_SIZEBORDER );
  751.         WinSendMsg( hwndFrame, WM_UPDATEFRAME,
  752.                     MPFROM2SHORT( FCF_SIZEBORDER, 0 ), 0L );
  753.  
  754.         ; Add the size border.
  755.         WinSetWindowBits( hwndFrame, QWL_STYLE, FS_SIZEBORDER,
  756.                           FS_SIZEBORDER );
  757.         WinSendMsg( hwndFrame, WM_UPDATEFRAME,
  758.                     MPFROM2SHORT( FCF_SIZEBORDER, 0 ), 0L );
  759.  
  760. ======================================================================
  761.                               EMAG10-14
  762.          Memory Requirements for Real-Mode CodeView (CV.EXE)
  763.                           (CodeView, Q66513)
  764.  
  765. Real-mode versions of CodeView (CV) beginning with version 3.00 offer
  766. a number of ways to utilize available memory in order to make the
  767. greatest amount of conventional memory available to the program being
  768. debugged. The amount of memory actually used depends on the command-
  769. line options specified as well as the configuration of the system used
  770. for debugging.
  771.  
  772. The following table shows the size of CodeView in standard DOS memory
  773. with each of the memory-specific command-line options (see below for
  774. further details):
  775.  
  776.    Option  RAM Usage                   Option  RAM Usage
  777.    ------  ---------                   ------  ---------
  778.    
  779.    /X       16K                       /D16     210K
  780.    /E      192K                       /D32     225K
  781.    /D      256K (same as /D64)        /D128    320K
  782.  
  783. The following descriptions of the three memory-related CodeView
  784. options explain the ways in which each option affects memory
  785. utilization in addition to the respective amounts of conventional
  786. memory that CodeView requires with each. (This information pertains
  787. only to CodeView versions 3.00 and later -- versions of CodeView
  788. earlier than 3.00 require approximately 230K of RAM specifically for
  789. CodeView.)
  790.  
  791. /X - Specifies that CodeView should utilize extended memory. Assuming
  792.     that enough extended memory is available, this option moves both
  793.     the symbolic information and most of CV itself into extended
  794.     memory. Allowing CV to be loaded into high memory requires that
  795.     approximately 16K to 19K of "control" code remain in conventional
  796.     memory; thus all free conventional RAM over 19K is available to
  797.     load the program to be debugged (the "debuggee").
  798.  
  799. /E - Specifies that CodeView should utilize expanded memory. Assuming
  800.     that enough expanded memory is available, this option moves both
  801.     the symbolic information and CodeView's own overlays into expanded
  802.     memory. The size of the CV "root" without the extra overlayed code
  803.     is approximately 192K. Since the overlays do not cause any
  804.     additional overhead with /E, all free conventional RAM over 192K
  805.     is available to load the debuggee.
  806.  
  807. /D - Specifies that CodeView should utilize disk overlays in
  808.     conventional memory. By default, this option creates a 64K buffer
  809.     area for loading disk overlays. With the 192K root, the 64K buffer
  810.     means CV will take about 256K of conventional memory with /D. In
  811.     addition, the symbolic information must also be loaded into
  812.     conventional memory; therefore, since symbolic data varies with
  813.     each program, it is not possible to specify the amount of memory
  814.     available for the debuggee alone.
  815.  
  816.     The /D option can also be specified with a value that indicates
  817.     the size of the overlay buffer area. This parameter can be any
  818.     value from 16 to 128, which represents an overlay buffer size from
  819.     16K to 128K. Specifying /D16 will minimize CodeView's size with
  820.     disk overlays to approximately 210K. This maximizes the amount of
  821.     conventional memory that will be available to load the debuggee
  822.     and the symbolic information. At the other extreme, /D128 causes
  823.     CV to use approximately 320K of conventional RAM. This provides
  824.     faster CodeView execution speed, but it will only work with
  825.     smaller debuggees.
  826.  
  827. Note: CodeView will default to the best memory usage possible. In
  828. other words, if NO memory usage option is specified, CV will try to
  829. use extended memory. If extended memory is unavailable, CV looks for
  830. expanded memory. CV will use disk overlays on its own only if expanded
  831. memory is not found.
  832.  
  833. ======================================================================
  834.                               EMAG10-15
  835.       How to Add Other Language Compilers to PWB's Build Options
  836.                             (PWB, Q65568)
  837.  
  838. The Programmer's WorkBench (PWB) is an environment capable of
  839. utilizing different compilers for mixed-language programming. When
  840. installed during BASIC version 7.10 setup, PWB version 1.10 shows
  841. build options for the BASIC language only. However, it is possible to
  842. include other language compilers to utilize the full features of the
  843. PWB utility.
  844.  
  845. The following information applies to the Programmer's WorkBench
  846. version 1.10 utility supplied with Microsoft BASIC Professional
  847. Development System (PDS) version 7.10 for MS-DOS and MS OS/2.
  848.  
  849. Note that the 1.00 version of PWB is shipped with Microsoft C
  850. Professional Development System (PDS) version 6.00. The steps below
  851. should also apply to PWB version 1.00.
  852.  
  853. The Programmer's WorkBench (PWB.EXE) is an advanced development
  854. environment capable of integrating several language compilers,
  855. NMAKE.EXE, LINK.EXE, and the CodeView debugger. It offers the ability
  856. to accomplish tasks, such as program development under protected mode
  857. and mixed-language programming. This ability is not available in the
  858. QuickBASIC extended development environment (QBX.EXE).
  859.  
  860. Two special files, PWBC.PX$ (for protected mode OS/2) and PWBC.MX$
  861. (for DOS mode), reside on the BASIC PDS 7.10 disks and support the
  862. option of using the C compiler in PWB. Since SETUP.EXE (in BASIC PDS
  863. 7.10) does not copy PWBC.PX$ and PWBC.MX$ during installation, these
  864. files must be unpacked and transferred to your machine; for example,
  865. to the \BINP subdirectory located in the \BC7 directory. (Note: The
  866. UNPACK.EXE utility is found on disk 1 of the BASIC PDS package.) After
  867. unpacking, the files will have the names PWBC.PXT and PWBC.MXT.
  868.  
  869. Next, the following command lines must be added to the TOOLS.INI file
  870. to make the C compiler available to PWB:
  871.  
  872.    [pwb - .BAS .BI]
  873.       LOAD: LogicalDrive:\[Path]\PWBC.PXT
  874.  
  875. For further information about installing PWBC.PXT and PWBC.MXT, see
  876. page 54 of the "Microsoft BASIC 7.1: Getting Started" manual.
  877.  
  878. If you want to program in languages other than BASIC or C (such as
  879. Microsoft Macro Assembler [MASM], Microsoft Pascal, Microsoft FORTRAN,
  880. or Microsoft COBOL 3.00/3.00a), the following steps will insert the
  881. initial build options to include other languages in PWB's build
  882. options menu. In the example below, options to include the MASM.EXE
  883. assembler are specified. If some other language's compiler is desired,
  884. substitute appropriate changes for that compiler, where noted in the
  885. specified areas.
  886.  
  887.  1. In PWB, go to the Options menu and select Build Options.
  888.  
  889.  2. Choose Save Current Build Options.
  890.  
  891.  3. Enter a meaningful message, such as "Options to Include MASM" in
  892.     the window's edit field (if some other language is desired, change
  893.     MASM to the appropriate name). Select the OK button from the Save
  894.     Current Build Options and Build Options windows.
  895.  
  896.  4. Open the TOOLS.INI file in the PWB utility and go down to the
  897.     bottom of the file. Somewhere near the bottom should be the tag
  898.     "[PWB-Build Options: Options to Include MASM]" (or the language
  899.     that was specified).
  900.  
  901.  5. In this section, add the following NMAKE instructions:
  902.  
  903.        build: inference .asm.obj masm_asm_obj
  904.        build: command masm_asm_obj "masm $<;"
  905.  
  906.     Note: For languages other than MASM, distinguish a variable name in
  907.     the inference rule to be used in the commands line (like
  908.     masm_asm_obj has been used above) and then specify the appropriate
  909.     compiler in the commands line within the quotation marks. The
  910.     special filename macro specified in the quotation marks, "$<",
  911.     applies the command to any object that has an out-of-date
  912.     executable file.
  913.  
  914.  6. Press SHIFT+F8 to reinitialize the file; and then close it.
  915.  
  916.  7. Go to the File menu and select New (it is a good idea to close any
  917.     lsfiles that are currently open before doing this step).
  918.  
  919.  8. Go to the Options menu and select Build Options.
  920.  
  921.  9. Choose Initial Build Options.
  922.  
  923. 10. Select the "Options to Include MASM" option (it should be near the
  924.     bottom of the list).
  925.  
  926. After completing these instructions, the PWB utility will now be ready
  927. to compile assembler along with BASIC source code, provided that paths
  928. to the necessary compilers are furnished.
  929.  
  930. ======================================================================
  931.                               EMAG10-16
  932.          What Happens to Stack Memory When Thread Terminates?
  933.                          (C Compiler, Q66295)
  934.  
  935. Question:
  936.  
  937. If I call _beginthread() with NULL as the second parameter, the run
  938. time is supposed to create a thread stack for me. How is this done?
  939. Also, when the thread terminates with _endthread(), is the memory
  940. automatically released back to the operating system?
  941.  
  942. Response:
  943.  
  944. If _beginthread() is called with NULL for the thread stack, a stack of
  945. size stack_size (passed as the third parameter) is malloc()'ed from
  946. the heap. At the time the thread is terminated, the stack is still in
  947. use; therefore, _endthread() does not automatically free it. In fact,
  948. the last things _endthread() does are to push the appropriate
  949. arguments onto the stack and call DosExit().
  950.  
  951. However, the memory is recovered. The next time that thread ID is
  952. used, _beginthread() will check to see if the thread stack was
  953. previously malloc()'ed internally by the function. If so, it will call
  954. free() at that time. Note that the thread memory doesn't go to the
  955. operating system; instead, it is returned to the heap. Due to the fact
  956. that OS/2 will use a thread ID from terminated threads first, there
  957. will usually be only one thread stack not free()'ed.
  958.  
  959. As a side note, in 32-bit OS/2, this is all a moot point. The 32-bit
  960. DosCreateThread() API call will automatically allocate/deallocate the
  961. thread stack.
  962.  
  963. ======================================================================
  964.                               EMAG10-17
  965.                    Using _psp for Pointer Checking
  966.                          (C Compiler, Q66127)
  967.  
  968. Problem:
  969.  
  970. I want to implement my own pointer checking routine. If the PSP
  971. (program segment prefix) is set up in the lowest segment of available
  972. memory, then I should be able to use _psp as the lower bounds for
  973. legal pointer segments. However, if I write a program that compares
  974. _psp with pointer segments returned by malloc(), I get back segment
  975. values less than _psp.
  976.  
  977. Response:
  978.  
  979. When DOS loads an .EXE or .COM file, the PSP is set up in the lowest
  980. segment of the largest contiguous block of available memory. There may
  981. be other blocks of available memory below the location of the PSP;
  982. however these blocks of memory are usually fairly small. If DOS
  983. returns one of these segments, when pointer checking is implemented
  984. with the /Zr option (available only with the /qc compiler option), the
  985. segment is simply discarded and DOS is called again. This process is
  986. repeated until a segment value greater than _psp is returned.
  987.  
  988. You can implement a similar routine in any C program by making calls
  989. to a function, as demonstrated below, rather than making calls
  990. directly to malloc(). However, the start-up code still will make calls
  991. to malloc() directly for environment and argument space. Thus, the
  992. pointer segments for the environment and arguments may still be less
  993. than _psp. Further, it should be noted that this routine does not
  994. implement pointer checking; it only enables programmers to implement
  995. their own pointer checking by comparing segment values against _psp.
  996.  
  997. Another method of getting only pointer segments greater than _psp is
  998. to modify the start-up code so that the value of _psp is stored at
  999. _aseglo. This is the actual location used to store the lower segment
  1000. limit when pointer checking is implemented. The code to check the
  1001. segment returned by DOS against this location, and to call DOS again
  1002. if necessary, is already implemented. If it is necessary to have
  1003. pointer segments for the environment and argument variables greater
  1004. than _psp, a similar assignment can be used to modify the start-up
  1005. code. If this assignment is done before the space for these variables
  1006. is allocated in the start-up code, they will have segment values
  1007. greater than _psp. However, you should be aware that Microsoft can
  1008. make no guarantees about the implementation of this feature in any
  1009. future releases.
  1010.  
  1011. If a call to malloc() requires a new segment to be allocated from the
  1012. operating system, the call to DOS will be made requesting only the
  1013. amount of memory required by the malloc(). In subsequent calls,
  1014. requests are made for 8K blocks of memory until no more memory is
  1015. available from that segment. Since the blocks of memory below the PSP
  1016. are small, they may not be allocated during the first calls to
  1017. malloc(). Thus, you cannot be sure exactly when these blocks of memory
  1018. will be allocated.
  1019.  
  1020. Code Example
  1021. ------------
  1022.  
  1023. void * _new_malloc (size_t size)
  1024.   {
  1025.   void * temp_ptr;
  1026.   temp_ptr= malloc (size);
  1027.   while ((temp_ptr != NULL) && (FP_SEG(temp_ptr) < _psp))
  1028.     temp_ptr= malloc (size);
  1029.   return temp_ptr;
  1030.   }
  1031.  
  1032. ======================================================================
  1033.                               EMAG10-18
  1034.          Differences/Enhancements from BASIC PDS 7.00 to 7.10
  1035.                        (BASIC Compiler, Q65598)
  1036.  
  1037. In August 1990, Microsoft released the Microsoft BASIC Professional
  1038. Development System (PDS) version 7.10 for MS-DOS and MS OS/2 systems.
  1039. This article documents those features that were added to BASIC PDS
  1040. 7.10 that are not supported in BASIC PDS 7.00. The lists below are
  1041. titled "Language Enhancements," "New Utilities and Utility
  1042. Improvements," and "Software Corrections."
  1043.  
  1044. This information applies to Microsoft BASIC Professional Development
  1045. System version 7.10 for MS-DOS and MS OS/2.
  1046.  
  1047. Language Enhancements
  1048. ---------------------
  1049.  
  1050. 1. REDIM PRESERVE changes the upper bounds (top-right dimension) of a
  1051.    $DYNAMIC array and preserves the data in the array. Previous
  1052.    versions of BASIC initialized the array to zeroes or null strings
  1053.    on a REDIM.
  1054.  
  1055. 2. It is now possible to pass fixed-length-string arrays as parameters
  1056.    to SUB and FUNCTION procedures.
  1057.  
  1058. 3. A CALL by value using BYVAL for BASIC SUB and FUNCTION subprograms
  1059.    is now possible. Previously, BASIC only supported CALL by value
  1060.    using BYVAL when calling a non-BASIC language such as C. The BYVAL
  1061.    attribute for passed parameters is now allowed when calling a BASIC
  1062.    SUB or FUNCTION.
  1063.  
  1064. 4. ISAM is now supported under OS/2. ISAM in PDS 7.10 can be used in
  1065.    OS/2 protected mode. (Note that ISAM in PDS 7.10 is still single-
  1066.    user ISAM as in 7.00.)
  1067.  
  1068. 5. ISAM support in 7.10 operates up to 50 percent faster than in 7.00,
  1069.    depending on the program.
  1070.  
  1071. 6. Communications input is buffered during a SHELL if the program was
  1072.    compiled with the BC /O (stand alone) option. All previous versions
  1073.    of BASIC disabled communications support and buffering of
  1074.    communications data during a SHELL. BASIC PDS 7.10 does not,
  1075.    however, buffer communications data during a SHELL if you are using
  1076.    the run-time module (BRT71xxx.EXE).
  1077.  
  1078. 7. BASIC PDS 7.10 now allows interlanguage calling to functions
  1079.    created with Microsoft C Compiler version 6.00. (BASIC PDS 7.00
  1080.    only allowed calling to Microsoft C Compiler version 5.10
  1081.    functions.)
  1082.  
  1083. New Utilities and Utility Improvements
  1084. --------------------------------------
  1085.  
  1086. 1. QBX.EXE improvement: The 7.10 QuickBASIC extended (QBX.EXE)
  1087.    environment uses expanded memory more efficiently than 7.00. In
  1088.    BASIC PDS 7.00, each subprogram from 1K to 16K in size uses a full
  1089.    16K of expanded memory. In BASIC PDS 7.10, subprograms smaller than
  1090.    16K will use expanded memory in 1K chunks. In 7.10, if a subprogram
  1091.    is 2K in size, it will use only 2K of expanded memory. (Subprograms
  1092.    larger than 16K are stored in conventional memory in both 7.00 and
  1093.    7.10.)
  1094.  
  1095. 2. Programmer's WorkBench (PWB), a new utility: The Programmer's
  1096.    WorkBench is the integrated development environment that is
  1097.    provided with Microsoft's newest "high-end" language products. It
  1098.    integrates the following features:
  1099.  
  1100.    -  Keyboard-driven or mouse-driven control of the WorkBench through
  1101.       use of menus and scroll bars.
  1102.  
  1103.    -  Ability to launch other utilities from PWB, such as NMAKE or
  1104.       CodeView.
  1105.  
  1106.    -  Context sensitive online Help.
  1107.  
  1108.    -  Multiple windows for managing multiple files for large projects.
  1109.  
  1110.    -  Multiple-language development within PWB.
  1111.  
  1112.    -  Supports development under both DOS and OS/2.
  1113.  
  1114.    -  Customizable program editor.
  1115.  
  1116.    -  Combines Microsoft's Quick environments (such as QuickBASIC and
  1117.       QuickC) and the Microsoft Editor, providing easier learning for
  1118.       anyone familiar with those environments. However, PWB offers
  1119.       many features over and above the Quick environments and the
  1120.       earlier Microsoft Editor.
  1121.  
  1122. 3. Source Browser: Source Browser is a powerful cross-referencing tool
  1123.    that can be launched from within PWB.
  1124.  
  1125. 4. The CodeView 3.10 debugger is included.
  1126.  
  1127. 5. NMAKE facility: A superset of the earlier Microsoft MAKE facility.
  1128.    PWB saves you the inconvenience of remembering makefile syntax by
  1129.    building and maintaining makefiles for you.
  1130.  
  1131. 6. QuickHelp: QuickHelp allows you to access online documentation
  1132.    without running QBX.EXE or PWB.EXE. QuickHelp can be run from the
  1133.    DOS or OS/2 command line and can also be installed as a keyboard
  1134.    monitor under OS/2. Any Help files with the correct format can be
  1135.    used with QuickHelp.
  1136.  
  1137. 7. QBX.EXE improvement: In the QBX environment under the Run menu, the
  1138.    Make .EXE File command now lets you set any BC.EXE compiler option
  1139.    in the "Additional Options:" field.
  1140.  
  1141. Software Corrections
  1142. --------------------
  1143.  
  1144. For a list of known problems with BASIC PDS 7.00 (or QuickBASIC 4.50)
  1145. that are corrected in BASIC PDS 7.10, query on the word "fixlist7.10".
  1146.  
  1147. ======================================================================
  1148.                               EMAG10-19
  1149.     How SUB and FUNCTION Windows Inherit DEFtype in QB.EXE Editor
  1150.                          (QuickBASIC, Q47491)
  1151.  
  1152. The following information applies to the QB.EXE editor in QuickBASIC
  1153. versions 4.00, 4.00b, and 4.50; to the QB.EXE editor in Microsoft
  1154. BASIC Compiler versions 6.00 and 6.00b; and to the QBX.EXE editor in
  1155. Microsoft BASIC Professional Development System (PDS) versions 7.00
  1156. and 7.10.
  1157.  
  1158. When creating SUB or FUNCTION procedures in the QB.EXE or QBX.EXE
  1159. editor, the procedures inherit the DEFtype statement shown in the
  1160. window in which they were first created. DEFtype refers to the
  1161. following statements: DEFINT, DEFLNG, DEFSNG, DEFDBL, DEFSTR, and
  1162. DEFCUR. (DEFCUR, which is a declaration for the CURRENCY data type, is
  1163. supported only in BASIC PDS 7.00 and 7.10.)
  1164.  
  1165. If no DEFtype statement is visible in a window, the default DEFSNG A-Z
  1166. applies. If a certain range of letters is not covered by a DEFtype
  1167. statement in the current window, then that range of letters is covered
  1168. by DEFSNG (since single precision is the default data type).
  1169.  
  1170. For more information in a related article, query on the following
  1171. words:
  1172.  
  1173.    DEFLNG and MISMATCH and $DYNAMIC
  1174.  
  1175. If the module-level code for the current module contains a DEFINT A-Z
  1176. statement, any SUB or FUNCTION created in that module automatically
  1177. has a DEFINT A-Z statement placed just above the SUB or FUNCTION line.
  1178.  
  1179. If a SUB or FUNCTION is created and moved to a module (source file)
  1180. with a different DEFtype than the module it was created in, the
  1181. SUBprogram and its new module have different default variable types,
  1182. and SHARED or passed variables may not be recognized in the
  1183. SUBprogram. In this case, the variables that were intended to be
  1184. SHARED may have the same name in both the SUBprogram and the module,
  1185. but the variables are of different types and, thus, are considered
  1186. different variables. You may encounter this same situation if you
  1187. create a SUBprogram (which "inherits" the module-level DEFtype) and
  1188. then change the DEFtype at the module level.
  1189.  
  1190. To avoid problems accessing SHARED or passed variables, you can either
  1191. append the appropriate type-specifier character (%, &, !, #, or $) to
  1192. the variable name, or make sure that all your SUBprograms have the
  1193. same DEFtype as the module that calls them.
  1194.  
  1195. Code Example
  1196. ------------
  1197.  
  1198. Executing the following code prints the values 0 and 10, whereas you
  1199. may have wanted 10 and 10. The reason for the difference is that while
  1200. Y% is always an integer variable (the "%" type specifier ensures this)
  1201. and, thus, is recognized as the COMMON SHARED variable Y% in the
  1202. subprogram, "X" is an integer (because of the DEFINT) at the module
  1203. level, and a double-precision variable (because of the DEFDBL before
  1204. the SUB) in the SUBprogram. Thus, Y% is recognized as SHARED and
  1205. changed correctly, while X is considered a local variable in the
  1206. SUBprogram and the COMMON SHARED variable X remains unaltered.
  1207.  
  1208.    'Module-level code:
  1209.    DEFINT A-Z
  1210.    COMMON SHARED X, Y%
  1211.    CALL thesub
  1212.    PRINT X, Y%
  1213.    END
  1214.  
  1215.    'SUBprogram level in same module -- different DEFtype statement:
  1216.    DEFDBL A-Z
  1217.    SUB thesub
  1218.      X = 5
  1219.      Y% = 10
  1220.    END SUB
  1221.  
  1222. ======================================================================
  1223.                               EMAG10-20
  1224.         Description of Stub Files and How They May Enlarge EXE
  1225.                        (BASIC Compiler, Q62908)
  1226.  
  1227. The stub files provided with Microsoft BASIC Professional Development
  1228. System (PDS) versions 7.00 and 7.10 for MS-DOS should be used only
  1229. under specific circumstances. If used incorrectly, linking with the
  1230. stub files may actually increase the size of the executable file.
  1231.  
  1232. A file in the Software/Data Library explains when to link with stub
  1233. files, the effects of each of the stub files, and when linking each
  1234. stub file may increase or decrease the size of a program. This file
  1235. can be found in the Software/Data Library by searching on the word
  1236. STUB700, the Q number of this article, or S12609. STUB700 was archived
  1237. using the PKware file conversion utility.
  1238.  
  1239. Please see the file mentioned above in the Software/Data Library for
  1240. more specific information about when to use the following BASIC PDS
  1241. 7.00 and 7.10 stub files:
  1242.  
  1243.    NOCGA.OBJ, NOEGA.OBJ, NOOGA.OBJ, NOHERC.OBJ NOVGA.OBJ NOGRAPH.OBJ
  1244.    NOCOM.OBJ, NOLPT.OBJ
  1245.    SMALLERR.OBJ
  1246.    87.LIB
  1247.    NOEVENT.OBJ
  1248.    NOEMS.OBJ
  1249.    OVLDOS21.OBJ
  1250.    NOFLTIN.OBJ
  1251.    NOEDIT.OBJ
  1252.    TSCNIONR.OBJ
  1253.    TSCNIOFR.OBJ
  1254.    TSCNIONP.OBJ
  1255.    TSCNIOFP.OBJ
  1256.    NOTRNEMR.LIB
  1257.    NOTRNEMP.LIB
  1258.    NOISAM.OBJ
  1259.  
  1260. Most stub files are useful only when you are compiling for use with
  1261. BCL7nxxx.LIB (compiling with BC /O) or making a customized run-time
  1262. module. When you compile for use with the default BRT7nxxx.EXE run-
  1263. time module, the support for BASIC language features is already built
  1264. into the run-time module and cannot be stubbed out without rebuilding
  1265. (customizing) the run-time module itself. (Two exceptions to this are
  1266. NOEMS.OBJ and OVLDOS21.OBJ, which affect overlay support in the BASIC
  1267. compiled executable .EXE program and don't affect the run-time
  1268. module.)
  1269.  
  1270. ======================================================================
  1271.                               EMAG10-21
  1272.         Which BASIC Versions Can CALL C, FORTRAN, Pascal, MASM
  1273.                          (QuickBASIC, Q35965)
  1274.  
  1275. Certain versions of Microsoft QuickBASIC and Microsoft BASIC Compiler
  1276. can CALL routines from certain other Microsoft languages (and pass
  1277. parameters), depending upon the product version number, as explained
  1278. below.
  1279.  
  1280. Microsoft BASIC Professional Development System (PDS) version 7.10 can
  1281. be linked with Microsoft C PDS version 6.00 or QuickC version 2.50 or
  1282. 2.51.
  1283.  
  1284. The following application note, which can be requested from Microsoft
  1285. Product Support Services, is required if you want to perform BASIC
  1286. 7.10 mixed-language programming with C 5.10, FORTRAN 5.00, or Pascal
  1287. 4.00:
  1288.  
  1289.    "How to Link BASIC PDS 7.10 with C 5.10, FORTRAN 5.00, or Pascal
  1290.    4.00" (application note number BB0345)
  1291.  
  1292. QuickBASIC 4.50 and BASIC PDS 7.00 (but not earlier versions) can
  1293. create .OBJ modules that can be linked with .OBJ modules from
  1294. Microsoft FORTRAN version 5.00 and Microsoft QuickC version 2.01.
  1295.  
  1296. QuickBASIC versions 4.00b and 4.50, Microsoft BASIC Compiler versions
  1297. 6.00 and 6.00b for MS-DOS and MS OS/2, and Microsoft BASIC PDS version
  1298. 7.00 for MS-DOS and MS OS/2 create .OBJ modules that can be linked
  1299. with .OBJ modules from the following languages:
  1300.  
  1301. 1. Microsoft Pascal version 4.00
  1302. 2. Microsoft FORTRAN version 4.10
  1303. 3. Microsoft C version 5.10 and QuickC versions 1.01 and 2.00
  1304. 4. Microsoft Macro Assembler (MASM) version 5.00 or later recommended,
  1305.    but earlier versions should also work
  1306.  
  1307. For more information on interlanguage CALLing between Microsoft C and
  1308. BASIC, query on the word "BAS2C".
  1309.  
  1310. For more information on interlanguage CALLing between Microsoft MASM
  1311. and BASIC, query on the word "BAS2MASM".
  1312.  
  1313. For more information about using the CALL statement to pass parameters
  1314. from BASIC to other languages, query on the following words:
  1315.  
  1316.    CALL and (PASSING or PASS) and [language name]
  1317.  
  1318. QuickBASIC 4.00
  1319. ---------------
  1320.  
  1321. QuickBASIC version 4.00 creates .OBJ modules that can be linked with
  1322. .OBJ modules from the following languages (Microsoft has performed
  1323. successful interlanguage test suites for QuickBASIC version 4.00 with
  1324. these language versions):
  1325.  
  1326. 1. Microsoft C version 5.00, QuickC version 1.00
  1327. 2. Microsoft FORTRAN version 4.00
  1328. 3. Microsoft Pascal version 4.00
  1329. 4. Microsoft Macro Assembler (MASM) versions 4.00 and later
  1330.    recommended, but earlier versions should also work
  1331.  
  1332. Note that QuickBASIC version 4.00b might link with these earlier
  1333. language versions, but Microsoft cannot guarantee success because the
  1334. 4.00b test suites were performed only on the later language versions
  1335. mentioned further above in this article.
  1336.  
  1337. QuickBASIC 1.x, 2.x, 3.00
  1338. -------------------------
  1339.  
  1340. In QuickBASIC versions 1.00, 1.01, 1.02, 2.00, 2.01, and 3.00, you can
  1341. link only to .OBJ modules from Microsoft Macro Assembler (versions
  1342. 1.2x, 2.x, or later) or the given version of QuickBASIC. In other
  1343. words, QuickBASIC versions 3.00 and earlier can CALL only QuickBASIC
  1344. subprograms or assembly routines.
  1345.  
  1346. Important Information About Interlanguage CALLing
  1347. -------------------------------------------------
  1348.  
  1349. To be compatible with compiled BASIC, programs should be assembled or
  1350. compiled using the medium, large, or huge memory model, and BASIC must
  1351. be linked first (as the main module).
  1352.  
  1353. When you link compiled BASIC to other compiled BASIC modules, compiler
  1354. versions should not be mixed. For example, an .OBJ module compiled in
  1355. QuickBASIC version 4.00 should not be linked with an .OBJ module
  1356. compiled in QuickBASIC version 4.00b or 4.50 or Microsoft BASIC
  1357. Compiler version 6.00 or 6.00b or Microsoft BASIC PDS version 7.00 or
  1358. 7.10.
  1359.  
  1360. As an alternative to the CALL statement for interlanguage invocation,
  1361. you may use the SHELL statement to invoke most (non-TSR) .EXE, .COM,
  1362. or .BAT programs that you can also invoke from DOS. SHELL works
  1363. differently than CALL. SHELL invokes another copy of the DOS
  1364. COMMAND.COM command processor before running a requested executable
  1365. program.
  1366.